package com.qzdatasoft.ratelimit.bean;

import lombok.Builder;
import lombok.Getter;

@Builder
@Getter
public class RateLimitRule {
    private final String resourceKey;  // resourceKey
    private final String urlPattern; // url
    private final String dimension; // 规则维度,GLOBAL、IP、USER等
    private final String user; // user
    private final String ip; // ip
    //private final boolean nodelay;   // 是否无延迟处理

    private final int burstCapacity; // 突发容量
//    private final int capacity; // 桶容量
    //private final int intervalNanos; // 每次请求通过的间隔n纳秒数
    private final int ratePerSecond; // 每秒允许的请求数
    private final double compensationRate; // 超额补偿比例
    private final int timeoutMillis; // 获取令牌超时时间
}
